package com.per.mybootall.designMode.factory;

import org.springframework.stereotype.Component;

/**
 * 工厂模式
 * */
@Component
public class CarFactoy {
    public Car getCar(String carName) {
        switch (carName) {
            case "A":
                return new CarA();
            case "B":
                return new CarA();
            case "C":
                return new CarC();
        }
        return null;
    }
}
